<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <h1>{{num}}</h1>
        <button @click.once="test">test</button>
        <!-- once只执行一次事件 -->
    </div>
    <script src="../Dev-tools/vue.js"></script>
    <script>
        new Vue({
            el:'#app',
            data:{ 
                num:0
            },
            methods:{
                test(){
                    this.num++
                    console.log("wangjiawei")
                }
            }
        })
    </script>
</body>
</html>